var uid = localStorage.getItem('uid');

var mr = ID('m20101root');


function m201Init()
{	
	if(uid==null||uid=='')
		return;
	
	udata = {
		'uid':uid,
	}
	
	mui.ajax(ASYURI+'M20101.do',{
		data:udata,
		dataType:'json',
		type:'post',
		timeout:10000,
		success:function(data){
			//write here.
			if(data.tag=='1')
			{
				liZInit("你还没有创建任何团体哦。");
			}
			else if(data.tag=='0')
			{
				var sdata = data[1];
				var slen = sdata.length;
				for(mi=0;mi<slen;mi++)
				{
					var msd = sdata[mi];
					liInit(msd.B1031,msd.B1030);
				}
			}
		},
		error:function(xhr,type,errorThrown){
			
		}
	});
}

function ID(id)
{
	return document.getElementById(id);
}
function liZInit(lVal1)
{
	var li = document.createElement("li");
	li.setAttribute("class","mui-table-view-cell");
	var a = document.createElement("a");
	a.innerHTML = lVal1;
	li.appendChild(a);
	mr.appendChild(li);
}
function liInit(lVal1,lVal2)
{
	var li = document.createElement("li");
	li.setAttribute("class","mui-table-view-cell");
	var a = document.createElement("a");
	a.setAttribute("class","mui-navigate-right");
	a.setAttribute("onclick","toPage('"+lVal2+"')");
	a.innerHTML = lVal1;
	li.appendChild(a);
	mr.appendChild(li);
}
function toPage(tid)
{
	localStorage.setItem("m20101tid",tid);
	mui.openWindow("m201011.html");
}

mui('body').on('tap','#m201headera1',function(){
	mui.openWindow("m2012.html");
});

m201Init();